const HtmlWebpackPlugin=require("html-webpack-plugin");
const webpack=require("webpack");
let path=require('path');
module.exports={
    entry:"./str/index.js",
    output:{
        filename:"main.js",
        path:path.join(__dirname,"./dist")
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:"./str/index.html"
        })
    ],
    mode:"development",
    module:{
        rules:[
            {
                test:/\.css$/,
                use:["style-loader","css-loader"]
            },
            {
                test:/\.(png|jpg|gif)$/,
                use:[
                    {
                        loader:"file-loader",
                        options:{}
                    }
                ]
            }
        ]
    },
    devServer:{
        host:"localhost",
        port:8080,
        hot:true,
        open:true
    }
}